class Solution:
    def hIndex(self, citations) -> int:
        h_val = len(citations)
        for i in citations:
            if i < h_val:
                h_val -= 1
            else:
                return h_val
        return 0


citations = [0,1,3,5,6]
citations = [100]
tester = Solution()
print(tester.hIndex(citations))